﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Rhino.Mocks;
using P.InOut.NetMvc.Controllers;
using P.InOut.NetMvc.Models;
using InOut.NetMvc.Tests.Properties;

namespace InOut.NetMvc.Tests.Controllers
{
    /// <summary>
    /// Summary description for UpdatesControllerTests
    /// </summary>
    [TestClass]
    public class UpdatesControllerTests
    {
        // Private objects for use in tests
        private MockRepository _mocks;
        private UpdatesController _controller;
        private Update _update;

        public UpdatesControllerTests()
        {
            // Instantiate private objects
            _mocks = new MockRepository();
            _controller = new UpdatesController();

            _update = new Update();
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        //[TestMethod]
        //public void 
        //Index_action_should_retrieve_Status_and_return_it_to_the_Index_View()
        //{
        //    string userName = "paulrday";
        //    object[] contextParams = { _controller, userName, null, null, null, null, null };
        //    ControllerContext fakeContext = 
        //        _mocks.DynamicMock<ControllerContext>(contextParams);

        //    // Execute Action
        //    var result = _controller.Index() as ViewResult;

        //    // Assign Properties
        //    var viewData = result.ViewData;
        //    var status = result.ViewData.Model as UpdatesViewData;

        //    Assert.IsNotNull(status);
        //    Assert.AreEqual("Index", result.ViewName);
        //}
    }
}
